<template>
  <vue-region v-bind="$attrs" :level="level" @change="change" v-on="$listeners" />
</template>

<script>
import { VueRegion } from "@halobear/vue";

export default {
  model: {
    prop: "value",
    event: "change"
  },
  components: {
    VueRegion
  },
  props: {
    level: {
      type: Number,
      default: 2
    }
  },
  methods: {
    change(value, region_name = "") {
      console.log();
      this.$emit(
        "change",
        value,
        region_name.split(" ").slice(0, this.level + 1)
      );
    }
  }
};
</script>

<style></style>
